﻿using System;
using System.Collections.Generic;
using System.Text;

namespace SweetSQL.Data
{
    /// <summary>
    /// Class used for building raw queries
    /// </summary>
    public sealed class RawQuery
    {
        /// <summary>
        /// RawQuery can implicit cast from a string
        /// </summary>
        /// <param name="sql">SQL text</param>
        /// <returns>New raw query instance</returns>
        public static implicit operator RawQuery(string sql)
        {
            return new RawQuery(sql);
        }

        /// <summary>
        /// SQL command text
        /// </summary>
        public string Sql
        {
            get;
            private set;
        }

        /// <summary>
        /// Constructor, requires SQL text
        /// </summary>
        /// <param name="sql">SQL text</param>
        public RawQuery(string sql)
        {
            Sql = sql;
        }

        /// <summary>
        /// List of ordered parameters to apply
        /// </summary>
        public List<object> Parameters
        {
            get;
            set;
        }
    }
}
